<?php
include_once "BaseDAO.php";

class AdCategorDAO extends BaseDAO {
	
	function __construct() {
		parent::__construct();
	}
	
	public function getAll() {
		$sql = "select * from adcategor order by sort asc";
		$result = mysql_query($sql);
		$items = $this::toArray($result);
		return $items;
	}
	
	public function getAdCategor($adId) {
		$sql ="select value from adcategorset a, adcategor b where a.AdCategorValue = b.value and a.adId =$adId";
		$result = mysql_query($sql);
		$items = $this::toArray($result, false);
		return $items;
	}
}

?>